home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 8
/
FM Towns Free Software Collection 8.iso
/
fb386
/
line2
/
line2.bas
< prev
next >
Wrap
BASIC Source File
|
1994-06-01
|
15KB
|
468 lines
1 CLS:SCREEN @1:RANDOMIZE TIME
2 CLEAR :DIM HEY%(19200/2+16) :DIM BOMB%(2*19200/2+16)
4 LOAD@ "BOMB.SND",BOMB% :LOAD@ "HEY.SND",HEY% :LOAD@"FMP.FMB"
5 ' ***********************
6 ' * Line Light V2.0 *
7 ' * *
8 ' * PROGRAMED BY TN *
9 ' ***********************
10 GOSUB *TITLE
20 GOSUB *画面作成
30 GOSUB *P2選択 :GOSUB *LEVEL選択 :P(0)=0 :P(1)=0
40 DEAD=0 :OLDA_SHOT=1 :OLDB_SHOT=1 :まがるP1=0:まがるP2=0
60 P1方向=2 :P2方向=4 :P1X=50:P1Y=120:P2X=280:P2Y=120
70 PSET (50,120),3 :PSET (280,120),5:MOUSE 1,75,75,0:MOUSE 4,0,0,319,239
76 CLS 1 :PLAY ON :P1逆=0 :P2逆=0 :COL1=3 :COL2=5 :L=0 :OPL=0
77 IT=75+INT(RND*50)
80 '------------------------------------------------------------
90 WHILE DEAD=0
91 OPL=PL
97 GOSUB *P1MOUSE :GOSUB *P2PAD
100 IF P2=1 GOSUB *かんがえる :ELSE GOSUB *P2どっちにすすむ
110 GOSUB *P1どっちにすすむ
111 IF LEVEL(1)=1 AND RND<.0005! GOSUB *まがっちゃう
120 GOSUB *P1しらべてかく
130 GOSUB *P2しらべてかく
131 IF LEVEL(1)=1 AND RND<.02! THEN GOSUB *イベント
132 IF P2=0 GOSUB *ウェイト
133 'GOSUB *P2しらべてかく
134 L=L+1 :PL=INT(L/10):LOCATE 10,23 :COLOR 6:
135 IF PL<>OPL THEN PRINT USING"このゲームの勝者は######点もらえるよ!";PL
140 WEND
150 '------------------------------------------------------------
160 GOSUB *GAMEOVER
170 IF C(0)=-1 THEN GOTO *REPLAY
180 SCREEN @1 :EOP=1:GOTO *おわる
190 '
200 '
210 *GAMEOVER
220 IF DEAD=1 THEN PAINT(50,120),1,0,4,5,1,7
230 IF DEAD=2 THEN PAINT(280,120),1,0,4,3,2
240 BEEP 363523,10,100 :PCMPLAY BOMB%
250 SYMBOL (95,75),"GAMEOVER",2,1.5!,4,,,2
280 IF DEAD=1 THEN SYMBOL (112,115),"2player win!",1,1,5,,,1 :
290 IF DEAD=2 THEN SYMBOL (112,115),"1player win!",1,1,3,,,1 :
291 '
292 ' LOCATE 50,15 :COLOR 4 :PRINT "2PLAYER :"+STR$(P(1))
293 GOSUB *POINT
300 WAIT 200 :C(0)=0 :C(1)=0
310 LINE (21,26)-(299,214),PSET,4,BF,0
320 SYMBOL (80,75),"もう一度しますか?<Y>左クリック /<N>右クリック",.5!,.5!,4
340 WHILE C(0)=0 AND C(1)=0
350 C(0)=MOUSE(2,0) :C(1)=MOUSE(2,1)
360 WEND
370 '
380 '
390 RETURN
400 '
410 *REPLAY
430 LINE (21,26)-(299,214),PSET,4,BF,0
440 C(0)=0 :C(1)=0 :CLS 1 :WAIT 20 :EOP=1 :CLS 1
450 GOTO 40
460 '
470 '
480 *ウェイト
490 FOR WA=0 TO IT
500 NEXT
510 RETURN
520 '
530 *P1どっちにすすむ
540 '
550 'まがるP1$=INKEY$
560 IF まがるP1=0 THEN RETURN
570 IF P1逆=0 AND まがるP1=1 THEN P1方向=P1方向-1
580 IF P1逆=0 AND まがるP1=2 THEN P1方向=P1方向+1
581 '
582 IF P1逆=1 AND まがるP1=1 THEN P1方向=P1方向+1
583 IF P1逆=1 AND まがるP1=2 THEN P1方向=P1方向-1
584 '
590 IF P1方向=0 THEN P1方向=4
600 IF P1方向=5 THEN P1方向=1
610 RETURN
620 '
630 '
640 *P2どっちにすすむ
650 'まがるP2$=INKEY$
655 IF まがるP2=0 THEN RETURN
660 IF P2逆DA=0 AND まがるP2=1 THEN P2方向=P2方向-1
670 IF P2逆DA=0 AND まがるP2=2 THEN P2方向=P2方向+1
671 '
672 IF P2逆DA=1 AND まがるP2=1 THEN P2方向=P2方向+1
673 IF P2逆DA=1 AND まがるP2=2 THEN P2方向=P2方向-1
674 '
680 IF P2方向=0 THEN P2方向=4
690 IF P2方向=5 THEN P2方向=1
700 RETURN
710 '
720 '
730 '----------------------------------
740 ' 下調べ サブルーチン
750 '----------------------------------
760 *画面作成
770 'LINE (0,0)-(325,240),PSET,0,BF ,&H00152345235145230
780 LINE (20,25)-(300,215),PSET,4,BF,0
782 LINE (21,26)-(299,214),PSET,4,BF,0
790 SYMBOL (85,16),"TN PLESENTS V2.0",1,.5!,4,,,2
800 SYMBOL (80,0),"Line Light",1,1,4,,,1
810 COLOR 3:LOCATE 10,4 :PRINT "PLAYER 1 "
820 LOCATE 10,5 :PRINT "マウスの左クリックで左に曲がる"
830 LOCATE 10,6 :PRINT " 右クリックで右に曲がる"
835 'LOCATE 10,7 :PRINT "キ-ボ-ドの *でSPEED UP "
840 COLOR 5:LOCATE 40,4 :PRINT"PLAYER 2 "
850 LOCATE 40,5 :PRINT "パッドの A で左に曲がる"
860 LOCATE 40,6 :PRINT " B で右に曲がる"
870 'LOCATE 40,7 :PRINT " ↓でSPEED UP"
880 SYMBOL (80,125),"マウスで選んでください",1,.5!,2,,,2
890 SYMBOL (85,150),"1P VS COM",.5!,1,7,,,1
900 SYMBOL (185,150),"1P VS 2P",.5!,1,7,,,1
910 LINE (185,150)-(245,166),XOR,6,BF
911 LINE (185,150)-(245,166),XOR,[50,0,0],BF
912 LINE (85,150)-(150,166),XOR,[50,0,0],BF
920 RETURN
930 '
940 '
950 *P2選択
960 MOUSE 0
970 MOUSE 4,85,150,235,166
980 MOUSE 1,100,100,1 :P2=0
985 '
990 IF MOUSE(0)<150 AND P2=0 THEN :LINE (185,150)-(245,166),XOR,6,BF:LINE (85,150)-(150,166),XOR,6,BF :P2=1
1000 IF MOUSE(0)>185 AND P2=1 THEN :LINE (85,150)-(150,166),XOR,6,BF:LINE (185,150)-(245,166),XOR,6,BF :P2=0
1010 IF MOUSE(0)<150 AND MOUSE(2,0)=-1 THEN LINE (85,150)-(150,166),OR,2,BF :GOTO 1040
1020 IF MOUSE(0)>185 AND MOUSE(2,0)=-1 THEN LINE (185,150)-(245,166),OR,2,BF :GOTO 1040
1030 GOTO 990
1035 '
1040 BEEP 363523,10,1000
1050 ' SYMBOL (225,350),"GAME START!!!",2,2,3,,,2
1060 WAIT 10 :
1070 GOSUB *効果_線
1080 RETURN
1090 '
1100 '
1110 '---------------------------------
1120 ' 調べて書くサブルーチン
1130 '---------------------------------
1140 '
1150 *P1しらべてかく
1160 P1OX=P1X :P1OY=P1Y
1170 IF P1方向=1 THEN P1Y=P1Y-1
1180 IF P1方向=2 THEN P1X=P1X+1
1190 IF P1方向=3 THEN P1Y=P1Y+1
1200 IF P1方向=4 THEN P1X=P1X-1
1201 '
1202 'IF P1逆=1 AND P1方向=1 THEN P1X=P1OX-1 :P1Y=P1OY
1203 'IF P1逆=1 AND P1方向=2 THEN P1Y=P1OY+1 :P1X=P1OX
1204 'IF P1逆=1 AND P1方向=3 THEN P1X=P1OX+1 :P1Y=P1OY
1205 'IF P1逆=1 AND P1方向=4 THEN P1Y=P1OY-1 :P1X=P1OX
1206 '
1220 GET@(P1X,P1Y)-(P1X,P1Y),P1調査
1240 IF P1調査(0)<>0 THEN DEAD=1
1260 PSET (P1X,P1Y),COL1
1280 RETURN
1290 '
1300 '
1310 *P2しらべてかく
1320 P2OX=P2X :P2OY=P2Y
1330 IF P2方向=1 THEN P2Y=P2Y-1
1340 IF P2方向=2 THEN P2X=P2X+1
1350 IF P2方向=3 THEN P2Y=P2Y+1
1360 IF P2方向=4 THEN P2X=P2X-1
1361 '
1362 'IF P2逆DA=1 AND P2方向=1 THEN P2X=P2OX-1 :P2Y=P2OY
1363 'IF P2逆DA=1 AND P2方向=2 THEN P2Y=P2OY+1 :P2X=P2OX
1364 'IF P2逆DA=1 AND P2方向=3 THEN P2X=P2OX+1 :P2Y=P2OY
1365 'IF P2逆DA=1 AND P2方向=4 THEN P2Y=P2OY-1 :P2X=P2OX
1366 '
1370 '
1380 GET@(P2X,P2Y)-(P2X,P2Y),P2調査
1390 '
1400 IF P2調査(0)<>0 THEN DEAD=2
1410 PSET (P2X,P2Y),COL2
1420 RETURN
1430 '
1440 '
1450 '-----------------------------------
1460 ' イベント関係
1470 '-----------------------------------
1480 *LEVEL選択
1481 COLOR 4 :CLS 1 :IF P2=0 THEN GOTO 1510
1482 LOCATE 10,20 :PRINT "コンピュータのLEVELを設定してください<1-3> "
1490 LOCATE 10,20 :INPUT "コンピュータのLEVELを設定してください<1-3>";LEVEL(0)
1500 IF LEVEL(0)<1 OR LEVEL(0)>3 GOTO 1480
1510 LOCATE 10,21 :PRINT "イベントはあった方がいいですか<Y/N> "
1520 LOCATE 10,21 :INPUT "イベントはあった方がいいですか<Y/N> ";IBE$
1530 IF IBE$="Y" OR IBE$="y" THEN LEVEL(1)=1 :RETURN
1540 IF IBE$="N" OR IBE$="n" THEN LEVEL(1)=0 :RETURN
1550 LOCATE 10,21 :PRINT "イベントはあった方がいいですか<Y/N> "
1560 GOTO 1510
1570 RETURN
1580 '
1590 '
1600 *イベント
1610 ON INT(RND*3)+1 GOSUB *HEY,*BOX,*逆
1615 'GOSUB *逆
1620 RETURN
1630 '
1640 *HEY
1650 SYMBOL (INT(RND*(597-43-32*2)+43)/2,INT(RND*(427-53-16*2)+53)/2),"HEY!",1,1,6
1660 HEY%(12)=1881 :HEY%(12)=HEY%(12)+(INT(RND*5)-2)*98 :PCMPLAY HEY%
1670 RETURN
1680 '
1690 *BOX
1700 LINE ((INT(RND*(597-42))+42)/2,(INT(RND*(427-52))+52)/2)-((INT(RND*(597-42))+42)/2,(INT(RND*(427-52))+52)/2),PSET,6,B,&HA5A0
1710 PLAY OFF:PLAY ON :PLAY "","V10 @70 L12 CD"
1720 RETURN
1730 '
1740 '
1750 *逆
1760 IF RND<RND/2 THEN RETURN
1770 ON INT(RND*2)+1 GOSUB 1790,1820
1775 RETURN
1780 '
1790 P1逆=P1逆+1 :COL1=2 :IF P1逆>1 THEN P1逆=0 :COL1=3
1800 PLAY OFF:PLAY ON :PLAY "","@69 C4" :PAINT(50,120),COL1,0,4,5,7
1805 RETURN
1810 '
1820 COL2=7 :P2逆=P2逆+1:IF P2逆>1 THEN P2逆=0 :COL2=5
1830 PLAY OFF:PLAY ON :PLAY "","@68 C4":PAINT(280,120),COL2,0,4,3,2
1835 IF P2=1 THEN P2逆DA=0 :GOSUB *まがれ:RETURN
1840 IF P2<>1 THEN P2逆DA=P2逆 :RETURN
1850 '
1851 '
1852 *まがれ
1853 P2方向=INT(P2方向+1)
1854 IF P2方向<1 THEN P2方向=4
1855 IF P2方向>4 THEN P2方向=1
1856 RETURN
1857 '
1858 *まがっちゃう
1859 IF RND<.2! THEN RETURN'
1860 LINE (22,27)-(298,213),XOR,[100,80,120],BF :
1861 PLAY OFF :PLAY ON :PLAY "","@61 D16G16A16"
1862 LINE (22,27)-(298,213),XOR,[100,80,120],BF
1871 RE=INT(RND*3)-1 :IF RE=0 GOTO 1871
1872 P1方向=P1方向+RE :P2方向=P2方向-RE
1873 IF P1方向<1 THEN P1方向=4
1874 IF P1方向>4 THEN P1方向=1
1875 IF P2方向<1 THEN P2方向=4
1876 IF P2方向>4 THEN P2方向=1
1877 RETURN
1878 '----------------------------
1879 ' おわる
1880 '--------------------------
1885 *おわる
1890 CLS
1900 INPUT "END OF THIS GAME? <Y/N>";Q$(0)
1910 IF Q$(0)="Y" OR Q$(0)="y" OR Q$(0)="N" OR Q$(0)="n" ELSE GOTO 1900
1920 IF Q$(0)="N" OR Q$(0)="n" THEN WAIT 50 :GOTO 20
1930 INPUT "END OF F-BASIC386? <Y/N>";Q$(1)
1940 IF Q$(1)="Y" OR Q$(1)="y" OR Q$(1)="N" OR Q$(1)="n" ELSE GOTO 1930
1950 IF Q$(1)="N" OR Q$(1)="n" THEN END
1960 INPUT "REALLY? <Y/N>";Q$(2)
1970 IF Q$(2)="Y" OR Q$(2)="y" OR Q$(2)="n" OR Q$(2)="N" ELSE GOTO 1960
1980 IF Q$(2)="N" OR Q$(2)="n"THEN CLS :GOTO 1900 ELSE SYSTEM
1990 '
2000 *POINT
2010 WAIT 50
2020 FOR V=1 TO INT(PL)
2030 IF DEAD=2 THEN P(0)=P(0)+1
2035 IF DEAD=1 THEN P(1)=P(1)+1
2040 COLOR 4 :LOCATE 10,15 :PRINT "1PLAYER :"+STR$(P(0))
2050 LOCATE 50,15 :PRINT "2PLAYER :"+STR$(P(1))
2060 PL=PL-1
2070 LOCATE 10,23 :COLOR 6:PRINT USING"このゲームの勝者は######点もらえるよ!";PL
2080 NEXT
2090 RETURN
2100 '
2110 '
2120 '
2130 *TITLE
2140 SCREEN @0
2150 CLS
2200 PALETTE 15,[0,0,0] :PALETTE 9,[0,0,0]
2210 SYMBOL (100,50),"Line Light",5,10,7,,,3
2220 SYMBOL (160,250),"Programed by TN",2,5,1,,,1
2225 '
2230 FOR PAL=0 TO 255
2240 PALETTE 15,[PAL,PAL,PAL]
2245 PALETTE 9,[PAL,PAL,INT(PAL/1.2!)]
2250 FOR Z=0 TO 20 :NEXT :NEXT
2270 '
2280 FOR PAL=0 TO 255
2290 PALETTE 15,[255-PAL/2,255-PAL,255]
2300 FOR Z=0 TO 5 :NEXT :NEXT
2305 SYMBOL (100,400),"Please mouse bottom",3,1,2
2310 '
2320 BGM 1 :MOUSE 0
2330 PLAY OFF :PLAY ON :PLAY "","","@35 C16D16","@76 V10","@36 V10","@113 V5"
2335 FOR Z=0 TO 5
2340 PLAY "","","L16<AAAAAAAAFFFFGGGG>","L8 CRCR L16 CRCRCRCR"," L8 RCRC L16RCRCRCRC","L16O3<AAAAAAAAFFFFGGGG>" :NEXT
2350 WHILE MOUSE(2,0)<>-1 AND MOUSE(2,1)<>-1 :WEND
2360 '
2361 SYMBOL (100,400),"Please mouse bottom",3,1,0
2370 FOR PAL=0 TO 225
2380 PALETTE 0,[PAL,0,PAL]
2390 FOR Z=0 TO 15 :NEXT :NEXT
2400 WAIT 75
2410 FOR PAL=0 TO 225
2420 PALETTE 0,[225-PAL,0,225-PAL]
2421 PALETTE 15,[255/2-INT(PAL/2),0,255-PAL]
2422 PALETTE 9,[255-PAL,255-PAL,INT(255/1.2!)-INT(PAL/1.2!)]
2430 FOR Z=0 TO 15 :NEXT:NEXT
2440 '
2450 PLAY OFF :SCREEN @1 :WAIT 100:RETURN
2460 '
11000 '---------------------------------
11010 ' 画面効果サブルーチン
11020 '---------------------------------
11030 '
11040 *効果_線
11050 '
11060 WAIT 10 :
11070 ' FOR Z=1 TO 75
11080 ' LINE (43,53+5*Z)-(597,427-5*Z),PSET,INT(RND*7)+1
11090 ' NEXT
11100 '
11110 ' FOR Z=1 TO 112
11120 ' LINE (597-5*Z,53)-(43+5*Z,427),PSET,INT(RND*7)+1
11130 ' NEXT
11140 LINE (21,26)-(299,214),PSET,4,B
11150 LINE (22,27)-(298,213),PSET,0,BF
11155 WAIT 30
11170 RETURN
11180 '
11190 '-----------------------------
11200 ' その他
11210 '-----------------------------
11220 *P2PAD
11230 '
11240 A_SHOT=PTRIG(1)
11250 B_SHOT=PTRIG(1)
11260 IF OLDA_SHOT=0 AND A_SHOT=1 THEN まがるP2=2
11270 IF OLDB_SHOT=0 AND B_SHOT=2 THEN まがるP2=1
11271 IF OLDA_SHOT=1 THEN まがるP2=0
11272 IF OLDB_SHOT=2 THEN まがるP2=0
11275 IF A_SHOT=0 AND B_SHOT=0 THEN まがるP2=0
11280 OLDA_SHOT=A_SHOT
11290 OLDB_SHOT=B_SHOT
11300 RETURN
11310 '
11320 '
11330 *P1MOUSE
11340 '
11350 L_CRK=MOUSE(2,0)
11360 R_CRK=MOUSE(2,1)
11370 IF OLDL_CRK=0 AND L_CRK=-1 THEN まがるP1=1
11380 IF OLDR_CRK=0 AND R_CRK=-1 THEN まがるP1=2
11390 IF OLDL_CRK=-1 THEN まがるP1=0
11400 IF OLDR_CRK=-1 THEN まがるP1=0
11410 IF L_CRK=0 AND R_CRK=0 THEN まがるP1=0
11420 OLDL_CRK=L_CRK
11430 OLDR_CRK=R_CRK
11440 RETURN
11450 '
20000 '---------------------------------
20010 ' 人工知能AI
20020 '
20030 *かんがえる
20035 判別=0
20040 ON P2方向 GOSUB *うえ,*みぎ,*した,*ひだり
20050 ON LEVEL(0) GOSUB *L1,*L2,*L3
20051 IF 判別<>0 ELSE RETURN
20055 GOSUB *判別
20060 RETURN
20070 '
20080 *うえ
20091 '
20092 ' AI1+
20093 ' AI2+
20094 ' AI3+
20095 ' AI7+ AI4+ AI8+
20096 ' AI5+ * AI6+
20097 '
20100 GET@(P2X,P2Y-7)-(P2X,P2Y-7),AI1%
20110 GET@(P2X,P2Y-5)-(P2X,P2Y-5),AI2%
20120 GET@(P2X,P2Y-2)-(P2X,P2Y-2),AI3%
20130 GET@(P2X,P2Y-1)-(P2X,P2Y-1),AI4%
20140 GET@(P2X-1,P2Y)-(P2X-1,P2Y),AI5%
20150 GET@(P2X+1,P2Y)-(P2X+1,P2Y),AI6%
20160 GET@(P2X-1,P2Y-1)-(P2X-1,P2Y-1),AI7%
20170 GET@(P2X+1,P2Y-1)-(P2X+1,P2Y-1),AI8%
20180 RETURN
20190 '
20200 *みぎ
20220 ' 5+ 7+
20230 ' * 4+ 3+ 2+ 1+
20240 ' 6+ 8+
20250 '
20260 GET@(P2X+7,P2Y)-(P2X+7,P2Y),AI1%
20270 GET@(P2X+5,P2Y)-(P2X+5,P2Y),AI2%
20280 GET@(P2X+2,P2Y)-(P2X+2,P2Y),AI3%
20290 GET@(P2X+1,P2Y)-(P2X+1,P2Y),AI4%
20300 GET@(P2X,P2Y-1)-(P2X,P2Y-1),AI5%
20310 GET@(P2X,P2Y+1)-(P2X,P2Y+1),AI6%
20320 GET@(P2X+1,P2Y-1)-(P2X+1,P2Y-1),AI7%
20330 GET@(P2X+1,P2Y+1)-(P2X+1,P2Y+1),AI8%
20340 RETURN
20350 '
20360 '
20370 *した
20390 ' 6+ * 5+
20400 ' 8+ 4+ 7+
20410 ' 3+
20420 ' 2+
20430 ' 1+
20440 '
20450 '
20460 GET@(P2X,P2Y+7)-(P2X,P2Y+7),AI1%
20470 GET@(P2X,P2Y+5)-(P2X,P2Y+5),AI2%
20480 GET@(P2X,P2Y+2)-(P2X,P2Y+2),AI3%
20490 GET@(P2X,P2Y+1)-(P2X,P2Y+1),AI4%
20500 GET@(P2X+1,P2Y)-(P2X+1,P2Y),AI5%
20510 GET@(P2X-1,P2Y)-(P2X-1,P2Y),AI6%
20520 GET@(P2X+1,P2Y+1)-(P2X+1,P2Y+1),AI7%
20530 GET@(P2X-1,P2Y+1)-(P2X-1,P2Y+1),AI8%
20540 RETURN
20550 '
20560 '
20570 *ひだり
20590 ' +8 +6
20600 ' +1 +2 +3 +4 *
20610 ' +7 +5
20620 GET@(P2X-7,P2Y)-(P2X-7,P2Y),AI1%
20630 GET@(P2X-5,P2Y)-(P2X-5,P2Y),AI2%
20640 GET@(P2X-2,P2Y)-(P2X-2,P2Y),AI3%
20650 GET@(P2X-1,P2Y)-(P2X-1,P2Y),AI4%
20660 GET@(P2X,P2Y+1)-(P2X,P2Y+1),AI5%
20670 GET@(P2X,P2Y-1)-(P2X,P2Y-1),AI6%
20680 GET@(P2X-1,P2Y+1)-(P2X-1,P2Y+1),AI7%
20690 GET@(P2X-1,P2Y-1)-(P2X-1,P2Y-1),AI8%
20700 RETURN
20710 '
20720 '
20730 *L1
20740 IF AI3%(0)<>0 OR AI1%(0)<>0 THEN 判別=1
20750 RETURN
20760 '
20770 *L2
20780 IF AI4%(0)<>0 OR AI3%(0)<>0 OR AI2%(0)<>0 OR AI1%(0)<>0 THEN 判別=1
20785 RETURN
20790 '
20800 *L3
20810 IF AI1%(0)<>0 THEN 判別=1
20811 IF AI2%(0)<>0 THEN 判別=1
20812 IF AI3%(0)<>0 THEN 判別=1
20813 IF AI4%(0)<>0 THEN 判別=1
20820 IF AI7%(0)<>0 AND AI8%(0)<>0 THEN 判別=2
20825 IF AI6%(0)<>0 OR AI5%(0)<>0 THEN 判別=3
20830 RETURN
20840 '
20850 *判別
20860 IF AI5%(0)=0 AND AI6%(0)=0 AND INT(RND*2)=0 THEN P2方向=P2方向+1
20870 IF AI5%(0)<>0 AND AI6%(0)=0 THEN P2方向=P2方向+1
20880 IF AI5%(0)=0 AND AI6%(0)<>0 THEN P2方向=P2方向-1
20890 IF AI5%(0)=0 AND AI6%(0)=0 AND INT(RND*2)=1 THEN P2方向=P2方向-1
20900 IF P2方向=0 THEN P2方向=4
20910 IF P2方向=5 THEN P2方向=1
20920 RETURN